import { Injectable } from '@angular/core';
import { BaseService, httpOptions } from "../../../core/service/base.service";
import { _HttpClient } from "@delon/theme";
import { Observable } from "rxjs";
import { catchError, tap } from "rxjs/operators";

@Injectable({
  providedIn: 'root'
})
export class TaskService extends BaseService{

  getUrl(): string {
    return "api/quartz";
  }

  constructor(http: _HttpClient) {
    super(http);
  }


  deleteJob(name,group): Observable<any> {
    return this.http.post<any>(this.getUrl() + '/delete?name='+ name + "&group=" + group, null, httpOptions).pipe(
      tap((obj: any) => this.log(`added object =${obj}`)),
      catchError(this.handleError<any>('addany')),
    );
  }
}
